package main

import (
	"github.com/nntaoli-project/goex"
	"github.com/nntaoli-project/goex/binance"
	"log"
	"os"
	"time"
)

var spotWs *binance.TestSpotWs

func createSpotWs() {

	spotWs = binance.NewTestSpotWs()
	spotWs.DepthCallback(func(depth *goex.Depth) {
		log.Println(depth)
	})
	//spotWs.TickerCallback(func(ticker *goex.Ticker) {
	//	log.Println(ticker)
	//})
	spotWs.TradeCallback(func(trade *goex.Trade) {
		log.Println(trade)
	})
}
func main() {
	os.Setenv("HTTPS_PROXY", "socks5://127.0.0.1:4781")
	os.Setenv("GOEX_LOG_LEVEL", "DEBUG")
	createSpotWs()

	//spotWs.SubscribeDepth(goex.BTC_USDT)
	//spotWs.SubscribeTicker(goex.LTC_USDT)
	spotWs.SubscribeTrade(goex.BTC_USDT)
	time.Sleep(11 * time.Minute)
}
